package javanlp;

import java.io.*;
import opennlp.tools.sentdetect.SentenceDetectorME;
import opennlp.tools.sentdetect.SentenceModel;
import opennlp.tools.util.InvalidFormatException;

public class StDetect{
	public static void main(String[] args) 
                throws InvalidFormatException,IOException {
            String fld = "C:/Users/lenovolap/Dropbox/java/NLP.models/";
            String trainedModel = fld+"/en-sent.zip";
            String paragraph = "How are your? This is Mike. How are you? This.";
            try (InputStream is = new FileInputStream(trainedModel)) 
            {
                SentenceModel model = new SentenceModel(is);
                SentenceDetectorME sdetector = new SentenceDetectorME(model);
                String st[] = sdetector.sentDetect(paragraph);
                for (int i=0; i<st.length;i++){
                    System.out.println(st[i]);
                }
            }
        }
}
